<div id="divPopUpProduct">
    <fieldset>
        <legend>Search</legend>
        <span class="caption">You can type a part of words</span>
        <?php echo $ajax->form('Product', 'post', array('update' => 'divPopUpProductPaginate', 'indicator' => 'indicator', 'url' => array('action' => 'popup_paginate'))); ?>
        <table>
            <tr>
                <td class="text-right"><?php echo $form->label('Product.supplier_id', 'Vendor'); ?></td>
                <td><?php echo $form->select('Product.supplier_id', $suppliers, $supplier_id); ?></td>
                <td class="text-right"><?php echo $form->label("Product.brand_id", 'Brand') ?></td>
                <td><?php echo $form->select("Product.brand_id", $brands) ?></td>
            </tr>
            <tr>
                <td class="text-right"><?php echo $form->label('Product.category_id', 'Category') ?></td>
                <td><?php echo $form->select('Product.category_id', $categories) ?></td>
                <td class="text-right"><?php echo $form->label('Product.type_id', 'Type') ?></td>
                <td><?php echo $form->select('Product.type_id', $types) ?></td>
            </tr>
            <tr>
                <td class="text-right"><?php echo $form->label('Product.part_no', 'Part no'); ?></td>
                <td><?php echo $form->text('Product.part_no', array('id' => 'PartNoSearch')); ?></td>
                <td class="text-right"><?php echo $form->label('Product.model', 'Model') ?></td>
                <td><?php echo $form->text("Product.model") ?></td>
            </tr>
            <tr>
                <td class="text-right"><?php echo $form->label('Product.title', 'Title'); ?></td>
                <td><?php echo $form->text('Product.title', array('size' => 80)); ?></td>
                <td class="text-right"><?php echo $form->label('CustProductSite.customer_id', 'Customer'); ?></td>
                <td><?php echo $form->select('CustProductSite.customer_id', $customers, $customer_id); ?></td>
            </tr>
            <tr>
                <td class="text-right top"><?php echo $form->label('Product.text', 'Description') ?></td>
                <td class="top">
                    <?php echo $form->textarea("Product.text", array('cols' => 78, 'rows' => 2)) ?>
                </td>
                <td class="text-right top"><?php echo $form->label('CustProductSite.site_id', 'Site'); ?></td>
                <td class="top">
                    <?php echo $form->select('CustProductSite.site_id', $sites, $site_id); ?>&nbsp;&nbsp;
                    <?php echo $form->submit('icon/search.png', array('id' => 'submit', 'style' => 'display: inline;')); ?>
                </td>
            </tr>
        </table>
        <?php echo $form->end(); ?>
                </fieldset>
                <div id="divPopUpProductPaginate">
        <?php
                    echo $this->requestAction('products/popup_paginate' .
                            (isset($supplier_id) ? '/supplier_id:' . $supplier_id : '') .
                            (isset($customer_id) ? '/customer_id:' . $customer_id : '') .
                            (isset($site_id) ? '/site_id:' . $site_id : ''),
                            array('return'));
        ?>
    </div>
</div>
<script type="text/javascript">
    $j(function() {
        $j("#CustProductSiteCustomerId").bind('change', function() {
            requestOptions("sites", "CustProductSiteCustomerId", "CustProductSiteSiteId");
        });
    })
</script>
